import { defineConfig } from 'vite'
import path from 'path'
import uni from '@dcloudio/vite-plugin-uni'
// https://vitejs.dev/config/
export default defineConfig({
  transpileDependencies: ['uview-ui'],
  plugins: [uni()],
  resolve: {
    alias: { '@': path.resolve(__dirname, 'src') },
  },
  base: '/',
  server: {
    proxy: {
      '/kc': {
        target: 'http://api.dev.tongzhuang.com',
        changeOrigin: true,
        logLevel: 'debug',
        rewrite: (path) => {
          return path.replace(/^\/kc/, '/kc')
        },
      },
    },
  },
})
